Skip to content

Conversation

@erikdubbelboer
Copy link
Collaborator

No description provided.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds validation to reject malformed IPv6 hostnames that contain mixed bracket syntax. It prevents the parser from accepting hostnames that incorrectly combine regular hostnames or IPv4 addresses with IPv6 bracket notation.

  • Added validation to detect and reject hostnames with misplaced '[' or ']' characters outside proper IPv6 format
  • Restructured the host parsing logic to check for invalid bracket usage before port validation
  • Added comprehensive tests to verify rejection of mixed bracket hostname patterns

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
uri.go Enhanced parseHost function to validate and reject hostnames with improper bracket usage
uri_test.go Added test cases to verify rejection of malformed IPv6 hostnames with mixed bracket syntax

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@erikdubbelboer erikdubbelboer merged commit a17ec74 into master Oct 5, 2025
10 of 11 checks passed
@erikdubbelboer erikdubbelboer deleted the fix-bad-ipv6 branch October 9, 2025 04:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants